package com.abc.service.consumer.controller;

import com.abc.service.provider.api.EchoService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Reference(version = "1.0.0")
    private EchoService echoService;

    @Value("${spring.application.name}")
    private String appName;

    @GetMapping(value = "/echo/app-name")
    public String echo() {
        return echoService.echo(appName);
    }


}
